﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class heartmanager : MonoBehaviour
{

    public Sprite brokenheart;
    public AudioClip ac;
	void Start ()
    {
		
	}
	

	void Update ()
    {
		
	}
    public void damaged()
    {
        GetComponent<SpriteRenderer>().sprite = brokenheart;
        AudioSource.PlayClipAtPoint(ac,Vector3.zero);
        Invoke("changescene", 1);
    }
    public void changescene()
    {
        UnityEngine.SceneManagement.SceneManager.LoadScene(2);
    }
}
